<template>
	<view class="xb-page">
		<form>
			<view class="xb-search-cell">
				<image style="width: 50px;height: 50px;" src="../../../static/inputsearch.png"></image>
				<input style="width: 100%;" v-model="formdata.keyword"  class="xb-search" placeholder-class="xb-"
				 placeholder="输入学员姓名或者手机号" />
			</view>
			<view @click="selectstu(item.id)" class="xb-list-cell page-list-wrapper" v-for="(item ,index) in studentList" :key="index">
				<view class="uni-flex uni-row page-stu-item " style="align-items: center;">
					<image style="width: 50px;height: 50px;" src="../../../static/head.png"></image>
					<view class="page_nick_name">{{item.name}}</view>
					<uniTag type="default" size="small" :text="item.statusdesc"></uniTag>
				</view>
				<!-- <checkbox :value="item.name" @change="check(item.id,checkids)" />{{item.name}} -->
			</view>
		</form>
	</view>
</template>

<script>
	import pageHead from '../../../components/page-head.vue'
	import uniTag from '../../../components/uni-tag'
	//import uniTag from '../../../components/uni-tag.vue'
	export default {
		components: {
			pageHead,
			uniTag,
		},
		onLoad: function(data) {
			//search();

		},
		data() {
			return {
				selectid: null,
				formdata: {
					keyword: '',
				},
				studentList: [{
					"name": "霄风",
					"statusdesc": "在职"

				}, {
					"name": "霄风",
					"statusdesc": "在职"

				}],

			}

		},
		methods: {

			selectstu(id) {
				this.selectid = id;
				uni.navigateTo({
					url: 'addclsonetoone?id=' + selectid
				})

			},
		
			check: function(id, checked) {
				if (checed) {
					var index = checkids.find((v, index, checkids) => {
						return v == id;
					});
					if (index < 0) {
						checkids.push(id);
					}
				} else {
					checkids.splice(checkids.findIndex(item => item === id), 1)
				}

			},
			async search() {
				const res = await queryStudent(formdata);
				if (res.success == true) {
					this.studentLis = res.data.values;
				} else {

				}
			},
			initData() {
				let data = formData;
				const res = selectstu(formdata);
				if (res.success == true) {

				} else {

				}

			},

		}
	}
</script>

<style scoped >
	@import "../../../common/uni.css";
	@import "../../../common/xb.css";

	.page-list-wrapper {
		padding-left: 15px;
		padding-right: 15px;
		padding-top: 10px;
		padding-bottom: 10px;
	}

	.page_nick_name {
		color: #999999;
		font-size: 30px;
	}

	.page-stu-item {}

	.page-stu-cell {}

	.page-stu-item {}
</style>
